layui.use(top.layuiuse,
    function () {
        var watermark = layui.watermark;
        var kaPublic = layui.kaPublic;
        var formDesigner = layui.formDesigner;
        var $ = layui.$;
        //公共
        var bodyUrl = kaPublic.initBodySetUp();
        //加载水印
        loadingWatermark(watermark, { color: "#000", color: "rgb(14 66 210 / 1)" });
        var data = [];
        var render = formDesigner.render({
            data: data,
            elem: '#formdesigner'
        });
        $("#logoImg").attr("src", "admin/images/logo1.png");
        // $("#logoTitle").html(bodyUrl.kaPublicTitle + "_" + $("#logoTitle").html());
        loadingWatermark(watermark, { id: "#sysTemOsRadioDivFormId", color: "rgb(14 66 210 / 1)" });
        loadingWatermark(watermark, { id: "#formDesignerForm", color: "rgb(14 66 210 / 1)" });
    }
)
// 保存按钮
function kaSaveJson(kaFormName, data) {
    var kaAjax = layui.kaAjax;
    var kaBgUrl = layui.kaBgUrl;
    var kaAjaxFormData = {
        "form": kaFormName,
        "val": data
    };
    console.log(JSON.stringify(kaAjaxFormData));
    kaAjax.ajax(kaBgUrl.url("saveFormDesigner"), function (rs) {
        if (rs.code == 200) { 
            layui.kaMsg.success("保存成功", "已完成保存表单设计器！");
        }
    }, kaAjaxFormData);
}